import NumberTimer from '../util/number'
import appendNumber from './appendNumber'

let isStart = false
const obj = new NumberTimer()
obj.onNumberCreated = (n, isPrime) => {
  appendNumber(n, isPrime)
}

window.onclick = function () {
  if (isStart) {
    obj.stop()
    isStart = false
  } else {
    isStart = true
    obj.start()
  }
}
